
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/physics/mechanics/api/body.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:27:34 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Body (Docstrings) &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../../../" id="documentation_options" src="../../../../_static/documentation_options.js"></script>
    <script src="../../../../_static/jquery.js"></script>
    <script src="../../../../_static/underscore.js"></script>
    <script src="../../../../_static/doctools.js"></script>
    <script src="../../../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../../../_static/sympy-notailtext-favicon.ico"/>
    <link href="body.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../../../genindex.html" />
    <link rel="search" title="Search" href="../../../../search.html" />
    <link rel="next" title="Joint (Docstrings)" href="joint.html" />
    <link rel="prev" title="Printing (Docstrings)" href="printing.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="joint.html" title="Joint (Docstrings)"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="printing.html" title="Printing (Docstrings)"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="../index.html" accesskey="U">Classical Mechanics</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Body (Docstrings)</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="body-docstrings">
<h1>Body (Docstrings)<a class="headerlink" href="#body-docstrings" title="Permalink to this headline">¶</a></h1>
<section id="module-sympy.physics.mechanics.body">
<span id="body"></span><h2>Body<a class="headerlink" href="#module-sympy.physics.mechanics.body" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.physics.mechanics.body.</span></span><span class="sig-name descname"><span class="pre">Body</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">masscenter</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mass</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">frame</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">central_inertia</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L10-L564"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body" title="Permalink to this definition">¶</a></dt>
<dd><p>Body is a common representation of either a RigidBody or a Particle SymPy
object depending on what is passed in during initialization. If a mass is
passed in and central_inertia is left as None, the Particle object is
created. Otherwise a RigidBody object will be created.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>name</strong> : String</p>
<blockquote>
<div><p>Defines the name of the body. It is used as the base for defining
body specific properties.</p>
</div></blockquote>
<p><strong>masscenter</strong> : Point, optional</p>
<blockquote>
<div><p>A point that represents the center of mass of the body or particle.
If no point is given, a point is generated.</p>
</div></blockquote>
<p><strong>mass</strong> : Sympifyable, optional</p>
<blockquote>
<div><p>A Sympifyable object which represents the mass of the body. If no
mass is passed, one is generated.</p>
</div></blockquote>
<p><strong>frame</strong> : ReferenceFrame, optional</p>
<blockquote>
<div><p>The ReferenceFrame that represents the reference frame of the body.
If no frame is given, a frame is generated.</p>
</div></blockquote>
<p><strong>central_inertia</strong> : Dyadic, optional</p>
<blockquote>
<div><p>Central inertia dyadic of the body. If none is passed while creating
RigidBody, a default inertia is generated.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The attributes that Body possesses will be the same as a Particle instance
or a Rigid Body instance depending on which was created. Additional
attributes are listed below.</p>
<p class="rubric">Examples</p>
<p>Default behaviour. This results in the creation of a RigidBody object for
which the mass, mass center, frame and inertia attributes are given default
values.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">body</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;name_of_body&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>This next example demonstrates the code required to specify all of the
values of the Body object. Note this will also create a RigidBody version of
the Body object.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">Point</span><span class="p">,</span> <span class="n">inertia</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mass</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;mass&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">masscenter</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="s1">&#39;masscenter&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">frame</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;frame&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ixx</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;ixx&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">body_inertia</span> <span class="o">=</span> <span class="n">inertia</span><span class="p">(</span><span class="n">frame</span><span class="p">,</span> <span class="n">ixx</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">body</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;name_of_body&#39;</span><span class="p">,</span> <span class="n">masscenter</span><span class="p">,</span> <span class="n">mass</span><span class="p">,</span> <span class="n">frame</span><span class="p">,</span> <span class="n">body_inertia</span><span class="p">)</span>
</pre></div>
</div>
<p>The minimal code required to create a Particle version of the Body object
involves simply passing in a name and a mass.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">mass</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;mass&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">body</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;name_of_body&#39;</span><span class="p">,</span> <span class="n">mass</span><span class="o">=</span><span class="n">mass</span><span class="p">)</span>
</pre></div>
</div>
<p>The Particle version of the Body object can also receive a masscenter point
and a reference frame, just not an inertia.</p>
<p class="rubric">Attributes</p>
<table class="docutils align-default">
<colgroup>
<col style="width: 5%" />
<col style="width: 95%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p>name</p></td>
<td><p>(string) The body’s name</p></td>
</tr>
<tr class="row-even"><td><p>masscenter</p></td>
<td><p>(Point) The point which represents the center of mass of the rigid body</p></td>
</tr>
<tr class="row-odd"><td><p>frame</p></td>
<td><p>(ReferenceFrame) The reference frame which the body is fixed in</p></td>
</tr>
<tr class="row-even"><td><p>mass</p></td>
<td><p>(Sympifyable) The body’s mass</p></td>
</tr>
<tr class="row-odd"><td><p>inertia</p></td>
<td><p>((Dyadic, Point)) The body’s inertia around its center of mass. This attribute is specific to the rigid body form of Body and is left undefined for the Particle form</p></td>
</tr>
<tr class="row-even"><td><p>loads</p></td>
<td><p>(iterable) This list contains information on the different loads acting on the Body. Forces are listed as a (point, vector) tuple and torques are listed as (reference frame, vector) tuples.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.ang_vel_in">
<span class="sig-name descname"><span class="pre">ang_vel_in</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">body</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L497-L527"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body.ang_vel_in" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns this body’s angular velocity with respect to the provided
rigid body or reference frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>body: Body or ReferenceFrame</strong></p>
<blockquote>
<div><p>The rigid body or reference frame to calculate the angular velocity in.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">ReferenceFrame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">,</span> <span class="n">frame</span><span class="o">=</span><span class="n">N</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">set_ang_vel</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="mi">5</span><span class="o">*</span><span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">B</span><span class="p">)</span>
<span class="go">5*N.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">ang_vel_in</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">5*N.x</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.apply_force">
<span class="sig-name descname"><span class="pre">apply_force</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">force</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">point</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reaction_body</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reaction_point</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L211-L312"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body.apply_force" title="Permalink to this definition">¶</a></dt>
<dd><p>Add force to the body(s).</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>force: Vector</strong></p>
<blockquote>
<div><p>The force to be applied.</p>
</div></blockquote>
<p><strong>point: Point, optional</strong></p>
<blockquote>
<div><p>The point on self on which force is applied.
By default self’s masscenter.</p>
</div></blockquote>
<p><strong>reaction_body: Body, optional</strong></p>
<blockquote>
<div><p>Second body on which equal and opposite force
is to be applied.</p>
</div></blockquote>
<p><strong>reaction_point</strong> : Point, optional</p>
<blockquote>
<div><p>The point on other body on which equal and opposite
force is applied. By default masscenter of other body.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>Applies the force on self or equal and oppposite forces on
self and other body if both are given on the desried point on the bodies.
The force applied on other body is taken opposite of self, i.e, -force.</p>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">Point</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">m</span><span class="p">,</span> <span class="n">g</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;m g&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">force1</span> <span class="o">=</span> <span class="n">m</span><span class="o">*</span><span class="n">g</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_force</span><span class="p">(</span><span class="n">force1</span><span class="p">)</span> <span class="c1">#Applying force on B&#39;s masscenter</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_masscenter, g*m*B_frame.z)]</span>
</pre></div>
</div>
<p>We can also remove some part of force from any point on the body by
adding the opposite force to the body on that point.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">f1</span><span class="p">,</span> <span class="n">f2</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;f1 f2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="s1">&#39;P&#39;</span><span class="p">)</span> <span class="c1">#Considering point P on body B</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_force</span><span class="p">(</span><span class="n">f1</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">f2</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">y</span><span class="p">,</span> <span class="n">P</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_masscenter, g*m*B_frame.z), (P, f1(t)*B_frame.x + f2(t)*B_frame.y)]</span>
</pre></div>
</div>
<p>Let’s remove f1 from point P on body B.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_force</span><span class="p">(</span><span class="o">-</span><span class="n">f1</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="n">P</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_masscenter, g*m*B_frame.z), (P, f2(t)*B_frame.y)]</span>
</pre></div>
</div>
<p>To further demonstrate the use of <code class="docutils literal notranslate"><span class="pre">apply_force</span></code> attribute,
consider two bodies connected through a spring.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span> <span class="c1">#Newtonion Frame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B2</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">spring_force</span> <span class="o">=</span> <span class="n">x</span><span class="o">*</span><span class="n">N</span><span class="o">.</span><span class="n">x</span>
</pre></div>
</div>
<p>Now let’s apply equal and opposite spring force to the bodies.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">P1</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="s1">&#39;P1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P2</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="s1">&#39;P2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span><span class="o">.</span><span class="n">apply_force</span><span class="p">(</span><span class="n">spring_force</span><span class="p">,</span> <span class="n">point</span><span class="o">=</span><span class="n">P1</span><span class="p">,</span> <span class="n">reaction_body</span><span class="o">=</span><span class="n">B2</span><span class="p">,</span> <span class="n">reaction_point</span><span class="o">=</span><span class="n">P2</span><span class="p">)</span>
</pre></div>
</div>
<p>We can check the loads(forces) applied to bodies now.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(P1, x(t)*N_frame.x)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B2</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(P2, - x(t)*N_frame.x)]</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>If a new force is applied to a body on a point which already has some
force applied on it, then the new force is added to the already applied
force on that point.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.apply_torque">
<span class="sig-name descname"><span class="pre">apply_torque</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">torque</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">reaction_body</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L314-L400"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body.apply_torque" title="Permalink to this definition">¶</a></dt>
<dd><p>Add torque to the body(s).</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>torque: Vector</strong></p>
<blockquote>
<div><p>The torque to be applied.</p>
</div></blockquote>
<p><strong>reaction_body: Body, optional</strong></p>
<blockquote>
<div><p>Second body on which equal and opposite torque
is to be applied.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>Applies the torque on self or equal and oppposite torquess on
self and other body if both are given.
The torque applied on other body is taken opposite of self,
i.e, -torque.</p>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;t&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">torque1</span> <span class="o">=</span> <span class="n">t</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_torque</span><span class="p">(</span><span class="n">torque1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_frame, t*B_frame.z)]</span>
</pre></div>
</div>
<p>We can also remove some part of torque from the body by
adding the opposite torque to the body.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">t1</span><span class="p">,</span> <span class="n">t2</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;t1 t2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_torque</span><span class="p">(</span><span class="n">t1</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">t2</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_frame, t1(t)*B_frame.x + t2(t)*B_frame.y + t*B_frame.z)]</span>
</pre></div>
</div>
<p>Let’s remove t1 from Body B.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_torque</span><span class="p">(</span><span class="o">-</span><span class="n">t1</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_frame, t2(t)*B_frame.y + t*B_frame.z)]</span>
</pre></div>
</div>
<p>To further demonstrate the use, let us consider two bodies such that
a torque <span class="math notranslate nohighlight">\(T\)</span> is acting on one body, and <span class="math notranslate nohighlight">\(-T\)</span> on the other.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">dynamicsymbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span> <span class="c1">#Newtonion frame</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B1&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B2</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B2&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">v</span> <span class="o">=</span> <span class="n">dynamicsymbols</span><span class="p">(</span><span class="s1">&#39;v&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">T</span> <span class="o">=</span> <span class="n">v</span><span class="o">*</span><span class="n">N</span><span class="o">.</span><span class="n">y</span> <span class="c1">#Torque</span>
</pre></div>
</div>
<p>Now let’s apply equal and opposite torque to the bodies.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span><span class="o">.</span><span class="n">apply_torque</span><span class="p">(</span><span class="n">T</span><span class="p">,</span> <span class="n">B2</span><span class="p">)</span>
</pre></div>
</div>
<p>We can check the loads (torques) applied to bodies now.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B1</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B1_frame, v(t)*N_frame.y)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B2</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B2_frame, - v(t)*N_frame.y)]</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>If a new torque is applied on body which already has some torque applied on it,
then the new torque is added to the previous torque about the body’s frame.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.clear_loads">
<span class="sig-name descname"><span class="pre">clear_loads</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L402-L421"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body.clear_loads" title="Permalink to this definition">¶</a></dt>
<dd><p>Clears the Body’s loads list.</p>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">force</span> <span class="o">=</span> <span class="n">B</span><span class="o">.</span><span class="n">x</span> <span class="o">+</span> <span class="n">B</span><span class="o">.</span><span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_force</span><span class="p">(</span><span class="n">force</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_masscenter, B_frame.x + B_frame.y)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">clear_loads</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.dcm">
<span class="sig-name descname"><span class="pre">dcm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">body</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L529-L564"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body.dcm" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the direction cosine matrix of this body relative to the
provided rigid body or reference frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>body: Body or ReferenceFrame</strong></p>
<blockquote>
<div><p>The rigid body or reference frame to calculate the dcm.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">orient_axis</span><span class="p">(</span><span class="n">B</span><span class="o">.</span><span class="n">frame</span><span class="p">,</span> <span class="n">B</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">x</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">B</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,       0,      0],</span>
<span class="go">[0,  cos(5), sin(5)],</span>
<span class="go">[0, -sin(5), cos(5)]])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">dcm</span><span class="p">(</span><span class="n">B</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">Matrix([</span>
<span class="go">[1,       0,      0],</span>
<span class="go">[0,  cos(5), sin(5)],</span>
<span class="go">[0, -sin(5), cos(5)]])</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.kinetic_energy">
<span class="sig-name descname"><span class="pre">kinetic_energy</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">frame</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L165-L209"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body.kinetic_energy" title="Permalink to this definition">¶</a></dt>
<dd><p>Kinetic energy of the body.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>frame</strong> : ReferenceFrame or Body</p>
<blockquote>
<div><p>The Body’s angular velocity and the velocity of it’s mass
center are typically defined with respect to an inertial frame but
any relevant frame in which the velocities are known can be supplied.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">ReferenceFrame</span><span class="p">,</span> <span class="n">Point</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">m</span><span class="p">,</span> <span class="n">v</span><span class="p">,</span> <span class="n">r</span><span class="p">,</span> <span class="n">omega</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;m v r omega&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">O</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="s1">&#39;O&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;P&#39;</span><span class="p">,</span> <span class="n">masscenter</span><span class="o">=</span><span class="n">O</span><span class="p">,</span> <span class="n">mass</span><span class="o">=</span><span class="n">m</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span><span class="o">.</span><span class="n">masscenter</span><span class="o">.</span><span class="n">set_vel</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">v</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">y</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span><span class="o">.</span><span class="n">kinetic_energy</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">m*v**2/2</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">N</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;N&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">ReferenceFrame</span><span class="p">(</span><span class="s1">&#39;b&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">set_ang_vel</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">omega</span> <span class="o">*</span> <span class="n">b</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="s1">&#39;P&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span><span class="o">.</span><span class="n">set_vel</span><span class="p">(</span><span class="n">N</span><span class="p">,</span> <span class="n">v</span> <span class="o">*</span> <span class="n">N</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">,</span> <span class="n">masscenter</span><span class="o">=</span><span class="n">P</span><span class="p">,</span> <span class="n">frame</span><span class="o">=</span><span class="n">b</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">kinetic_energy</span><span class="p">(</span><span class="n">N</span><span class="p">)</span>
<span class="go">B_ixx*omega**2/2 + B_mass*v**2/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="../index.html#module-sympy.physics.mechanics" title="sympy.physics.mechanics"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.physics.mechanics</span></code></a></dt><dd><p>Particle, RigidBody</p>
</dd>
</dl>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.masscenter_vel">
<span class="sig-name descname"><span class="pre">masscenter_vel</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">body</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L466-L495"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body.masscenter_vel" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the velocity of the mass center with respect to the provided
rigid body or reference frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>body: Body or ReferenceFrame</strong></p>
<blockquote>
<div><p>The rigid body or reference frame to calculate the velocity in.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">masscenter</span><span class="o">.</span><span class="n">set_vel</span><span class="p">(</span><span class="n">B</span><span class="o">.</span><span class="n">frame</span><span class="p">,</span> <span class="mi">5</span><span class="o">*</span><span class="n">B</span><span class="o">.</span><span class="n">frame</span><span class="o">.</span><span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">masscenter_vel</span><span class="p">(</span><span class="n">B</span><span class="p">)</span>
<span class="go">5*B_frame.x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">A</span><span class="o">.</span><span class="n">masscenter_vel</span><span class="p">(</span><span class="n">B</span><span class="o">.</span><span class="n">frame</span><span class="p">)</span>
<span class="go">5*B_frame.x</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.remove_load">
<span class="sig-name descname"><span class="pre">remove_load</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">about</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/physics/mechanics/body.py#L423-L464"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.physics.mechanics.body.Body.remove_load" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove load about a point or frame.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>about</strong> : Point or ReferenceFrame, optional</p>
<blockquote>
<div><p>The point about which force is applied,
and is to be removed.
If about is None, then the torque about
self’s frame is removed.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Example</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.physics.mechanics</span> <span class="kn">import</span> <span class="n">Body</span><span class="p">,</span> <span class="n">Point</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span> <span class="o">=</span> <span class="n">Body</span><span class="p">(</span><span class="s1">&#39;B&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">P</span> <span class="o">=</span> <span class="n">Point</span><span class="p">(</span><span class="s1">&#39;P&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f1</span> <span class="o">=</span> <span class="n">B</span><span class="o">.</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f2</span> <span class="o">=</span> <span class="n">B</span><span class="o">.</span><span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_force</span><span class="p">(</span><span class="n">f1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">apply_force</span><span class="p">(</span><span class="n">f2</span><span class="p">,</span> <span class="n">P</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_masscenter, B_frame.x), (P, B_frame.y)]</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">remove_load</span><span class="p">(</span><span class="n">P</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">B</span><span class="o">.</span><span class="n">loads</span>
<span class="go">[(B_masscenter, B_frame.x)]</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.x">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">x</span></span><a class="headerlink" href="#sympy.physics.mechanics.body.Body.x" title="Permalink to this definition">¶</a></dt>
<dd><p>The basis Vector for the Body, in the x direction.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.y">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">y</span></span><a class="headerlink" href="#sympy.physics.mechanics.body.Body.y" title="Permalink to this definition">¶</a></dt>
<dd><p>The basis Vector for the Body, in the y direction.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.physics.mechanics.body.Body.z">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">z</span></span><a class="headerlink" href="#sympy.physics.mechanics.body.Body.z" title="Permalink to this definition">¶</a></dt>
<dd><p>The basis Vector for the Body, in the z direction.</p>
</dd></dl>

</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../../index.html">
              <img class="logo" src="../../../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Body (Docstrings)</a><ul>
<li><a class="reference internal" href="#module-sympy.physics.mechanics.body">Body</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="printing.html"
                        title="previous chapter">Printing (Docstrings)</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="joint.html"
                        title="next chapter">Joint (Docstrings)</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../../_sources/modules/physics/mechanics/api/body.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="joint.html" title="Joint (Docstrings)"
             >next</a> |</li>
        <li class="right" >
          <a href="printing.html" title="Printing (Docstrings)"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="../../index.html" >Physics</a> &#187;</li>
          <li class="nav-item nav-item-3"><a href="../index.html" >Classical Mechanics</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Body (Docstrings)</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/physics/mechanics/api/body.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:27:35 GMT -->
</html>